package main

import "fmt"

func main() {
	//test()
	//test2()
	test3()
}

func test() {
	map1 := make(map[string]string)
	map1["age"] = "19"
	map1["name"] = "lwl"
	map1["sex"] = "男"

	map2 := make(map[string]string)
	map2["age"] = "20"
	map2["name"] = "zq"
	map2["sex"] = "女"

	sss := make([]map[string]string, 0, 3)

	//sss := make([]map[string]string,0,3)
	sss = append(sss, map1)
	sss = append(sss, map2)
	//fmt.Println(sss)

	for i, val := range sss {
		i += 1
		fmt.Printf("第%d个人,姓名:%s\n", i, val["name"])
		//fmt.Print("\t姓名\n：",val["name"])
	}
}

func test2() {
	map1 := make(map[string]string)
	map1["age"] = "333"
	map1["name"] = "lwl"
	map2 := map1
	map2["age"] = "fadf"
	fmt.Println(map1, map2)
}

func test3() {
	map_1 := make(map[string]string)
	map_1["name"] = "lwl"
	map_1["age"] = "27"
	map_1["sex"] = "男"

	map_2 := make(map[string]string)
	map_2["name"] = "kobe"
	map_2["age"] = "45"
	map_2["sex"] = "男"

	sss_ := make([]map[string]string, 0, 2)
	sss_ = append(sss_, map_1)
	sss_ = append(sss_, map_2)
	fmt.Println(sss_)
}
